const { defineConfig } = require('@vue/cli-service')
const NodePolyfillPlugin = require('node-polyfill-webpack-plugin')


module.exports = defineConfig({
  transpileDependencies: true,
  pages: {
    index: {
      entry: "./src/views/index/index.js",
      template: "./src/views/index/index.html",
      filename: "index.html",
      title: "欢迎来到kun吧,一个为交流而生的平台"
    },
    integral: {
      entry: "./src/views/integral/integral.js",
      template: "./src/views/integral/integral.html",
      filename: "integral.html",
      title: "了解你的积分流水"
    },
    game: {
      entry: "./src/views/game/game.js",
      template: "./src/views/game/game.html",
      filename: "game.html",
      title: "小霸王回忆童年的乐趣"
    },
    chat: {
      entry: "./src/views/chat/chat.js",
      template: "./src/views/chat/chat.html",
      filename: "chat.html",
      title: "聊天室"
    },
    spansor: {
      entry: "./src/views/spansor/spansor.js",
      template: "./src/views/spansor/spansor.html",
      filename: "spansor.html",
      title: "赞助"
    },
    shop: {
      entry: "./src/views/shop/shop.js",
      template: "./src/views/shop/shop.html",
      filename: "shop.html",
      title: "商城"
    },
    loginByPassword: {
      entry: "./src/views/login/loginByPassword.js",
      template: "./src/views/login/loginByPassword.html",
      filename: "loginByPassword.html",
      title: "用户密码登录"
    },
    loginByPhone: {
      entry: "./src/views/login/loginByPhone.js",
      template: "./src/views/login/loginByPhone.html",
      filename: "loginByPhone.html",
      title: "用户电话短信登录"
    },
    loginByEmail: {
      entry: "./src/views/login/loginByEmail.js",
      template: "./src/views/login/loginByEmail.html",
      filename: "loginByEmail.html",
      title: "用户邮箱验证码登录"
    },
    regByPhone: {
      entry: "./src/views/register/regByPhone.js",
      template: "./src/views/register/regByPhone.html",
      filename: "regByPhone.html",
      title: "用户电话短信注册"
    },
    regByEmail: {
      entry: "./src/views/register/regByEmail.js",
      template: "./src/views/register/regByEmail.html",
      filename: "regByEmail.html",
      title: "用户邮箱验证码注册"
    },
    rechargeResultSuccess: {
      entry: "./src/views/rechargeResultSuccess/rechargeResultSuccess.js",
      template: "./src/views/rechargeResultSuccess/rechargeResultSuccess.html",
      filename: "rechargeResultSuccess.html",
      title: "支付成功"
    },
    rechargeResultFail: {
      entry: "./src/views/rechargeResultFail/rechargeResultFail.js",
      template: "./src/views/rechargeResultFail/rechargeResultFail.html",
      filename: "rechargeResultFail.html",
      title: "支付失败"
    },
    put: {
      entry: "./src/views/put/put.js",
      template: "./src/views/put/put.html",
      filename: "put.html",
      title: "发布"
    },
    personalCenter: {
      entry: "./src/views/personalCenter/personalCenter.js",
      template: "./src/views/personalCenter/personalCenter.html",
      filename: "personalCenter.html",
      title: "个人主页"
    },
    ChangeInfo: {
      entry: "./src/views/ChangeInfo/ChangeInfo.js",
      template: "./src/views/ChangeInfo/ChangeInfo.html",
      filename: "ChangeInfo.html",
      title: "个人信息修改"
    },
    MessageBoard: {
      entry: "./src/views/MessageBoard/MessageBoard.js",
      template: "./src/views/MessageBoard/MessageBoard.html",
      filename: "MessageBoard.html",
      title: "留言"
    },
    Management: {
      entry: "./src/views/Management/Management.js",
      template: "./src/views/Management/Management.html",
      filename: "Management.html",
      title: "管理员登录界面"
    },
    detail: {
      entry: "./src/views/detail/detail.js",
      template: "./src/views/detail/detail.html",
      filename: "detail.html",
      title: "详情"
    },
    blogReplyManager: {
      entry: "./src/views/blogReplyManager/blogReplyManager.js",
      template: "./src/views/blogReplyManager/blogReplyManager.html",
      filename: "blogReplyManager.html",
      title: "管理帖子"
    },
    blogAndUserManager: {
      entry: "./src/views/blogAndUserManager/blogAndUserManager.js",
      template: "./src/views/blogAndUserManager/blogAndUserManager.html",
      filename: "blogAndUserManager.html",
      title: "管理中心"
    },
    blogSelectSimilar:{
      entry: "./src/views/blogSelectSimilar/blogSelectSimilar.js",
      template: "./src/views/blogSelectSimilar/blogSelectSimilar.html",
      filename: "blogSelectSimilar.html",
      title: "搜索结果"
    },
    ttf: {
      entry: "./src/views/ttf/ttf.js",
      template: "./src/views/ttf/ttf.html",
      filename: "ttf.html",
      title: "特效"
    },
    otherUserCenter: {
      entry: "./src/views/otherUserCenter/otherUserCenter.js",
      template: "./src/views/otherUserCenter/otherUserCenter.html",
      filename: "otherUserCenter.html",
      title: "其他用户主页"
    },
    collect: {
      entry: "./src/views/collect/collect.js",
      template: "./src/views/collect/collect.html",
      filename: "collect.html",
      title: "收藏夹"
    },
    onecollect: {
      entry: "./src/views/onecollect/onecollect.js",
      template: "./src/views/onecollect/onecollect.html",
      filename: "onecollect.html",
      title: "某收藏夹"
    },
    page404:{
      entry: "./src/views/404/404.js",
      template: "./src/views/404/404.html",
      filename: "404.html",
      title: "404"
    }

  },
  configureWebpack: {
    // webpack.config.js
    resolve: {
      // 1.不需要node polyfilss
      alias: {
        crypto: false
      },
    },
    plugins: [
      new NodePolyfillPlugin(),
    ],
    resolve: { fallback: { fs: false } },

  },

})

